
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpInfoBusigl.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpInfoBusiglForm"
 */
public class CcpInfoBusiglForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cfbgGuid = null;
   private java.lang.String _glCode = null;
   private java.lang.String _cfbLabel = null;
   private java.lang.String _glUnit = null;
   private java.lang.String _stateCode = null;
   private java.lang.String _sysOrder = null;
   private java.lang.String _remark = null;
   private java.lang.String _cssclass = null;
   private java.lang.String _leafflag = null;

   /**
    * Standard constructor.
    */
   public CcpInfoBusiglForm() {
   }

   /**
    * Returns the cfbgGuid
    *
    * @return the cfbgGuid
    */
   public java.lang.String getCfbgGuid() {
      return _cfbgGuid;
   }

   /**
    * Sets the cfbgGuid
    *
    * @param cfbgGuid the new cfbgGuid value
    */
   public void setCfbgGuid(java.lang.String cfbgGuid) {
      _cfbgGuid = cfbgGuid;
   }
   /**
    * Returns the glCode
    *
    * @return the glCode
    */
   public java.lang.String getGlCode() {
      return _glCode;
   }

   /**
    * Sets the glCode
    *
    * @param glCode the new glCode value
    */
   public void setGlCode(java.lang.String glCode) {
      _glCode = glCode;
   }
   /**
    * Returns the cfbLabel
    *
    * @return the cfbLabel
    */
   public java.lang.String getCfbLabel() {
      return _cfbLabel;
   }

   /**
    * Sets the cfbLabel
    *
    * @param cfbLabel the new cfbLabel value
    */
   public void setCfbLabel(java.lang.String cfbLabel) {
      _cfbLabel = cfbLabel;
   }
   /**
    * Returns the glUnit
    *
    * @return the glUnit
    */
   public java.lang.String getGlUnit() {
      return _glUnit;
   }

   /**
    * Sets the glUnit
    *
    * @param glUnit the new glUnit value
    */
   public void setGlUnit(java.lang.String glUnit) {
      _glUnit = glUnit;
   }
   /**
    * Returns the stateCode
    *
    * @return the stateCode
    */
   public java.lang.String getStateCode() {
      return _stateCode;
   }

   /**
    * Sets the stateCode
    *
    * @param stateCode the new stateCode value
    */
   public void setStateCode(java.lang.String stateCode) {
      _stateCode = stateCode;
   }
   /**
    * Returns the sysOrder
    *
    * @return the sysOrder
    */
   public java.lang.String getSysOrder() {
      return _sysOrder;
   }

   /**
    * Sets the sysOrder
    *
    * @param sysOrder the new sysOrder value
    */
   public void setSysOrder(java.lang.String sysOrder) {
      _sysOrder = sysOrder;
   }
   /**
    * Returns the remark
    *
    * @return the remark
    */
   public java.lang.String getRemark() {
      return _remark;
   }

   /**
    * Sets the remark
    *
    * @param remark the new remark value
    */
   public void setRemark(java.lang.String remark) {
      _remark = remark;
   }
   /**
    * Returns the cssclass
    *
    * @return the cssclass
    */
   public java.lang.String getCssclass() {
      return _cssclass;
   }

   /**
    * Sets the cssclass
    *
    * @param cssclass the new cssclass value
    */
   public void setCssclass(java.lang.String cssclass) {
      _cssclass = cssclass;
   }
   /**
    * Returns the leafflag
    *
    * @return the leafflag
    */
   public java.lang.String getLeafflag() {
      return _leafflag;
   }

   /**
    * Sets the leafflag
    *
    * @param leafflag the new leafflag value
    */
   public void setLeafflag(java.lang.String leafflag) {
      _leafflag = leafflag;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCfbgGuid() == null) {
         errors.add("cfbgGuid", new ActionError("error.cfbgGuid.required"));
      }
      if(getCssclass() == null) {
         errors.add("cssclass", new ActionError("error.cssclass.required"));
      }
      // TODO test format/data
      return errors;
   }
}
